<%@ page import="com.example.rk.entity.Admin" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>XXXX后端管理系统</title>
    <jsp:include page="../common_css.jsp"/>

</head>
<body>
<div class="container-scroller">
    <!-- partial:partials/_navbar.html -->
    <jsp:include page="../top.jsp"/>

    <!-- partial -->
    <div class="container-fluid page-body-wrapper">
        <!-- partial:partials/_sidebar.html -->
        <jsp:include page="./left.jsp"/>
        <!-- partial -->
        <div class="main-panel">
            <div class="row">
                <div class="col-md-12 stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <p class="card-title">问卷管理</p>
                            <div class="table-responsive">
                                题目<input type="text" id="title" value="${pageInfo.search1}">
                                <input type="button" onclick="doSearch(1)" value="查询">
                                <table id="recent-purchases-listing" class="table">
                                    <thead>
                                    <tr>
                                        <th>id</th>
                                        <th>题目</th>
                                        <th>回复人</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach var="item" items="${pageInfo.list}">
                                        <tr>
                                            <<td>${item.id}</td>
                                            <td>${item.title}</td>
                                            <td>${item.name}</td>
                                            <td>
                                                <a href="#"
                                                   onclick="{window.location.href='/choice/open/${item.id}'}">查看内容</a>
                                                <a href="#"
                                                   onclick="if (confirm('确认要删除选中的记录吗？')){window.location.href='/choice/delete1/${item.id}'}">删除</a>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>

                                <jsp:include page="../page.jsp"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <jsp:include page="../footer.jsp"/>
    </div>
    <!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<jsp:include page="../common_js.jsp"/>
</body>

</html>
<script>
    function doSearch(pageNum) {
        var title=$("#title").val();
        window.location.href="/choice/list1?pageNum="+pageNum+"&title="+title;
    }
</script>